package com.xukehong.frame;

import com.xukehong.frame.entity.Role;
import com.xukehong.frame.entity.User;
import com.xukehong.frame.service.IUserService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

/**
 * @author 许克弘
 * @date 2020/2/29 22:44
 * 初始化
 */
@SpringBootTest
public class Default {

    @Autowired
    private IUserService userService;



    @Test
    public void createAdmin() {
        User user = new User();
        user.setUsername("admin");
        user.setEmail("1750687108@qq.com");
        user.setPassword(new BCryptPasswordEncoder().encode("123456"));
        user.setStatus(1);
        userService.insert(user);
    }

    //添加权限
    @Test
    public void createRole(){

    }
}
